All About CAPTCHA's: Decoding CAPTCHA's for Fun and Profit by Benjamin Boyter

All About CAPTCHA's: Decoding CAPTCHA's for Fun and Profit by Benjamin Boyter

Author:Benjamin Boyter [Boyter, Benjamin]
Language: eng
Format: azw3
Published: 2015-08-02T16:00:00+00:00


Again like before what the above does is open up each of our sample images and then trains the network on them. I ended up playing around with the number of nodes and managed to get a low error rate with 25 inputs and 3 hidden nodes. This is interesting as the last network used 400 inputs and 3 hidden nodes, and at first I was sceptical if the network had learnt this pattern correctly.

Of course we need something to test the effectiveness of our network and so I created the below test script which should take care of this and should let us see if the network does work correctly.

1 import unittest 2 import Loader 3 4 class TestClassifyAfromB(unittest.TestCase): 5 def setUp(self): 6 self.c = Loader.Loader() 7 self.x = 10 8 self.y = 10 9 10 def testLearnA(self): 11 n = self.c.loadnn(filename='aznn.n') 12 guess = n.guess(self.c.loadimagedata("./letters/A.gif",self.x,self.y)) 13 self.assertTrue(guess[0] > 0.95) 14 15 def testLearnB(self): 16 n = self.c.loadnn(filename='aznn.n') 17 guess = n.guess(self.c.loadimagedata("./letters/B.gif",self.x,self.y)) 18 self.assertTrue(guess[0] < 0.05) 19 20 def testLearnC(self): 21 n = self.c.loadnn(filename='aznn.n') 22 for let in 'B2 B3 C D E F G H I J K L M N O P Q R S T U V W X Y Z'.split(' '\ 23 ): 24 guess = n.guess(self.c.loadimagedata("./letters/%s.gif"%(let),self.x,self.\ 25 y)) 26 self.assertTrue(guess[0] < 0.05) 27 28 if __name__ == '__main__': 29 unittest.main() 30 The above is just a quick and dirty test and the results of which are, 31 32 $python TestStep2.py 33 ... 34 ---------------------------------------------------------------------- 35 Ran 3 tests in 0.015s 36 37 OK



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.